﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GUI
{
    public partial class VareKatalog : Form
    {
        public VareKatalog()
        {
            InitializeComponent();
        }

        private void VareKatalog_Load(object sender, EventArgs e)
        {
            Controller.Vaerksted v = Controller.Vaerksted.GetInstance();

            var Ydelser = from varer in v.VKatalog.Varer where varer.Value is SBS.Ydelse select new { VareNr = varer.Value.VareNr, Beskrivelse = varer.Value.VareNavn, Pris = varer.Value.VarePris};

            var Reservedele = from res in v.VKatalog.Varer where res.Value is SBS.Reservedel select new { VareNR = res.Value.VareNr, Beskrivelse = res.Value.VareNavn, Pris = res.Value.VarePris };

            YdelseDataGridView.DataSource = Ydelser.ToList();

            ReservedeleDataGridView.DataSource = Reservedele.ToList();
        }
    }
}
